/*
********************************************************************************
* Copyright (C) 2021, xiang.D <dx_65535@163.com>.
* All right reserved.
*
* File Name   : main.cc
* Author      :
* Version     : V1.0
* Description :
* Journal     : 2021-02-19 init v1.0
* Brief       : Blog: https://blog.csdn.net/qq_38750572?spm=1001.2014.3001.5343
* Others      :
********************************************************************************
*/
#include <stdio.h>
#include "iterator.h"
#include "aggregate.h"

int main(int argc, char *argv[])
{
    int i = 0;
    CAggregate<int> *agg = new CAggregate<int>();
    CIterator<int> it(agg);

    agg->push_back(1);
    agg->push_back(2);
    agg->push_back(13);

    for (it.First(); it.IsEnd(); it.Next())
    {
        printf("[%d]: %d\n", i, *it.CurPos());
        i++;
    }

    return 0;
}